/**
 * Created by Administrator on 15-7-1.
 */
var AccountList = RichBase.extend({
	statics : {},
	EVENTS : {},
	init : function(){},
	getHash : function(){ return $("#hashHidInp").val()},
	//获取默认回复消息
	getRes_default : function(){

	},
	//获取欢迎消息-文本
	getRes_wel_txt : function(){

	},
	//获取欢迎消息-图文
	getRes_wel_picTxt : function(){

	},
	getAccountList : function(config){
		var FN = new Function();
		var config = config || {};
		var loading = config.loading || FN;
		var removeLoading = config.removeLoading || FN;
		var success = config.success || FN;
		var empty = config.empty || FN;
		var fail = config.fail || FN;
		var timeout = config.timeout || FN;
		var error = config.error || FN;
		$.ajax({
			url : WXB.URLS.api,
			type : "GET",
			dataType : "JSON",
			timeout : WXB.AJAX_TIMEOUT,
			data : { action:"GetWechatBinded"},
			beforeSend : function(){
				loading();
			},
			success : function(res){
				removeLoading();
				if(res && res.status == "ok"){
					if(res.list && res.list.length){
						success(res);
					}else{
						empty(res);
					}
				}else if(res && res.status == "fail"){
					fail(res.msg);
				}else{
					error();
				}
			},
			error : function(xhr,txt){
				removeLoading();
				if(txt == "timeout"){
					timeout();
				}else{
					error();
				}
			}
		})
	}
})